<template>
  <!-- 修改资料 -->

  <div>
    <!-- 内容主题区域 -->
    <el-form label-width="85px" :model="form" label-position="right" ref="formRef" :rules="formRules" class="borderNone">
      <el-row>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="部门编号" prop="number">
            <el-input v-model="form.number" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="部门名称" prop="name">
            <el-input v-model="form.name" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="所属公司" prop="companyName">
            <el-input v-model="form.companyName" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="上级部门" prop="parentName">
            <el-input v-model="form.parentName" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="联系电话" prop="phone">
            <el-input v-model="form.phone" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="部门分类" prop="fax">
            <el-input v-model="form.fax" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="负责人" prop="leader" disabled>
            <el-input v-model="form.leader" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="顺序号" prop="itemIndex">
            <el-input-number v-model="form.itemIndex" :min="0" :max="99" disabled />
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
          <el-form-item label="状态" prop="status">
            <el-switch v-model="form.status" size="large" inline-prompt :active-icon="Check" :inactive-icon="Close"
              active-value="normal" inactive-value="disable" disabled />
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="备注" prop="remark">
            <el-input v-model="form.remark" disabled></el-input>
          </el-form-item>
        </el-col>
        <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24">
          <el-form-item label="传真" prop="fax">
            <el-input v-model="form.fax" disabled></el-input>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <div class="button-position">
      <el-button @click="updateVisible" type="primary">退 出</el-button>
    </div>
  </div>
</template>


<script setup>
import { ref, onMounted } from "vue";
import Api from '@/api/model/user'
const emit = defineEmits(['updatetable'])
const props = defineProps({
  paramsData: {
    type: Object,
    defalut: {},
  },
});

onMounted(() => {
  getData();
});
// 查看用户数据的对象
const form = ref({});

const updateVisible = (val) => {
  emit('updatetable')
};

//调取数据
const getData = async () => {
  let params = {
    id:props.paramsData.id
  }
  let res = await Api.dept.detail.post(params);
  console.log(res)
  if (res.code == 200) {
    form.value = res.data;
  } else {
    form.value = "";
  }
};
</script>

<style lang="less" scoped>
.borderNone {
  :deep(.el-input__wrapper) {
    box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
    cursor: default;
    background-color: transparent; //背景颜色透明
    border-bottom: 1px solid #999;
    border-radius: 0;

    .el-input__inner {
      cursor: default !important;
    }
  }
}
</style>

